package cn.hk.confirm.controller;

import cn.HK.vo.SystemResult;
import cn.hk.confirm.service.OrderConfirmService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class OrderConfirmController {
    @Autowired
    private OrderConfirmService orderService;
    @RequestMapping(value = "/order/confirmOrder",method = RequestMethod.POST)
    public SystemResult confirmOrder(Integer oId,Boolean confirm,String oMsg,Integer oScore){
        try{
            if(confirm){
                orderService.confirmOrder(oId,oMsg,oScore);
            }
            return SystemResult.ok();
        }catch (Exception e){
            e.printStackTrace();
            return SystemResult.build(201,oMsg,null);
        }
    }
}
